package standard;

import standard.util.Utils;

/**
 * Create by Lingo
 */

public class ColAndVar {
    private String varName;
    private String colName;
    private String jdbcType;
    private String javaType;
    private String javaClassName;
    private int isPrimary;

    public ColAndVar(ColumnInfo columnInfo) {
        this.colName = columnInfo.getName();
        this.varName = Utils.colName2VarName(colName);
        this.jdbcType = columnInfo.getMybatisTypeName();
        this.javaType = columnInfo.getJavaClassName();
        this.isPrimary = columnInfo.getIsPrimary();
        this.javaClassName = Utils.handleClassName(javaType);
    }

    public String getVarName() {
        return varName;
    }

    public void setVarName(String varName) {
        this.varName = varName;
    }

    public String getColName() {
        return colName;
    }

    public void setColName(String colName) {
        this.colName = colName;
    }

    public String getJdbcType() {
        return jdbcType;
    }

    public void setJdbcType(String jdbcType) {
        this.jdbcType = jdbcType;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
        this.javaClassName = Utils.handleClassName(javaType);
    }

    public int getIsPrimary() {
        return isPrimary;
    }

    public void setIsPrimary(int isPrimary) {
        this.isPrimary = isPrimary;
    }

    public String getJavaClassName() {
        return javaClassName;
    }

    private void setJavaClassName(String javaClassName) {
        this.javaClassName = javaClassName;
    }
}
